﻿@using WebMarkupMin.Sample.Logic.Models
@using WebMarkupMin.Sample.Resources

@model XhtmlMinificationViewModel

@{
	ViewBag.Title = "XHTML Minifier";
}

<h2>@ViewBag.Title</h2>

<form asp-controller="XhtmlMinifier" asp-action="Index" method="post" data-form-type="minification-form">
	<div class="minification-form">
		<div class="minification-input-output">
			@{ await Html.RenderPartialAsync("_MinificationInputOutput", Model); }
		</div>
		<div class="minification-settings">
			<div class="minification-settings-inner">
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_SpacesCommentsAndCdataSections</legend>
					<div class="form-group">
						<select asp-for="Settings.WhitespaceMinificationMode"
							asp-items="Model.Settings.WhitespaceMinificationModeList"
							class="form-control">
						</select>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.PreserveNewLines">
							<input asp-for="Settings.PreserveNewLines" />
							@Html.DisplayNameFor(m => m.Settings.PreserveNewLines)
						</label>
					</div>
					<div class="form-group">
						<select asp-for="Settings.NewLineStyle"
							asp-items="Model.Settings.NewLineStyleList"
							class="form-control">
						</select>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.RemoveHtmlComments">
							<input asp-for="Settings.RemoveHtmlComments" />
							@Html.DisplayNameFor(m => m.Settings.RemoveHtmlComments)
						</label>
					</div>
					<div class="form-group">
						<input asp-for="Settings.PreservableHtmlCommentList" class="form-control"
							placeholder="@CommonHtmlMinificationStrings.DisplayName_PreservableHtmlCommentList" />
					</div>
					<div class="checkbox">
						<label asp-for="Settings.RemoveHtmlCommentsFromScriptsAndStyles">
							<input asp-for="Settings.RemoveHtmlCommentsFromScriptsAndStyles" />
							@Html.DisplayNameFor(m => m.Settings.RemoveHtmlCommentsFromScriptsAndStyles)
						</label>
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_DoctypeTagsAndAttributes</legend>
					<div class="checkbox">
						<label asp-for="Settings.UseShortDoctype">
							<input asp-for="Settings.UseShortDoctype" />
							@Html.DisplayNameFor(m => m.Settings.UseShortDoctype)
						</label>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.UseMetaCharsetTag">
							<input asp-for="Settings.UseMetaCharsetTag" />
							@Html.DisplayNameFor(m => m.Settings.UseMetaCharsetTag)
						</label>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.RenderEmptyTagsWithSpace">
							<input asp-for="Settings.RenderEmptyTagsWithSpace" />
							@Html.DisplayNameFor(m => m.Settings.RenderEmptyTagsWithSpace)
						</label>
					</div>
					<div class="checkbox checkbox-unsafe">
						<label asp-for="Settings.RemoveTagsWithoutContent">
							<input asp-for="Settings.RemoveTagsWithoutContent" />
							@Html.DisplayNameFor(m => m.Settings.RemoveTagsWithoutContent)
						</label>
					</div>
					<div class="form-group">
						<select asp-for="Settings.AttributeQuotesStyle"
							asp-items="Model.Settings.AttributeQuotesStyleList"
							class="form-control">
						</select>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.RemoveEmptyAttributes">
							<input asp-for="Settings.RemoveEmptyAttributes" />
							@Html.DisplayNameFor(m => m.Settings.RemoveEmptyAttributes)
						</label>
					</div>
					<div class="checkbox checkbox-unsafe">
						<label asp-for="Settings.RemoveRedundantAttributes">
							<input asp-for="Settings.RemoveRedundantAttributes" />
							@Html.DisplayNameFor(m => m.Settings.RemoveRedundantAttributes)
						</label>
					</div>
					<div class="form-group">
						<input asp-for="Settings.PreservableAttributeList" class="form-control"
							placeholder="@CommonHtmlMinificationStrings.DisplayName_PreservableAttributeList" />
					</div>
					<div class="checkbox checkbox-unsafe">
						<label asp-for="Settings.RemoveHttpProtocolFromAttributes">
							<input asp-for="Settings.RemoveHttpProtocolFromAttributes" />
							@Html.DisplayNameFor(m => m.Settings.RemoveHttpProtocolFromAttributes)
						</label>
					</div>
					<div class="checkbox checkbox-unsafe">
						<label asp-for="Settings.RemoveHttpsProtocolFromAttributes">
							<input asp-for="Settings.RemoveHttpsProtocolFromAttributes" />
							@Html.DisplayNameFor(m => m.Settings.RemoveHttpsProtocolFromAttributes)
						</label>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.RemoveJsProtocolFromAttributes">
							<input asp-for="Settings.RemoveJsProtocolFromAttributes" />
							@Html.DisplayNameFor(m => m.Settings.RemoveJsProtocolFromAttributes)
						</label>
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_EmbeddedAndInlineCss</legend>
					<div class="form-group">
						<select asp-for="Settings.CssMinifierName"
							asp-items="Model.Settings.AvailableCssMinifierList"
							class="form-control">
						</select>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.MinifyEmbeddedCssCode">
							<input asp-for="Settings.MinifyEmbeddedCssCode" />
							@Html.DisplayNameFor(m => m.Settings.MinifyEmbeddedCssCode)
						</label>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.MinifyInlineCssCode">
							<input asp-for="Settings.MinifyInlineCssCode" />
							@Html.DisplayNameFor(m => m.Settings.MinifyInlineCssCode)
						</label>
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_EmbeddedAndInlineJavaScript</legend>
					<div class="form-group">
						<select asp-for="Settings.JsMinifierName"
							asp-items="Model.Settings.AvailableJsMinifierList"
							class="form-control">
						</select>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.MinifyEmbeddedJsCode">
							<input asp-for="Settings.MinifyEmbeddedJsCode" />
							@Html.DisplayNameFor(m => m.Settings.MinifyEmbeddedJsCode)
						</label>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.MinifyInlineJsCode">
							<input asp-for="Settings.MinifyInlineJsCode" />
							@Html.DisplayNameFor(m => m.Settings.MinifyInlineJsCode)
						</label>
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_EmbeddedJson</legend>
					<div class="checkbox">
						<label asp-for="Settings.MinifyEmbeddedJsonData">
							<input asp-for="Settings.MinifyEmbeddedJsonData" />
							@Html.DisplayNameFor(m => m.Settings.MinifyEmbeddedJsonData)
						</label>
					</div>
				</fieldset>
				<fieldset>
					<legend>@CommonHtmlMinificationStrings.ControlGroup_JavaScriptTemplating</legend>
					<div class="form-group">
						<input asp-for="Settings.ProcessableScriptTypeList"
							class="form-control"
							placeholder="@CommonHtmlMinificationStrings.DisplayName_ProcessableScriptTypeList" />
					</div>
					<div class="checkbox">
						<label asp-for="Settings.MinifyKnockoutBindingExpressions">
							<input asp-for="Settings.MinifyKnockoutBindingExpressions" />
							@Html.DisplayNameFor(m => m.Settings.MinifyKnockoutBindingExpressions)
						</label>
					</div>
					<div class="checkbox">
						<label asp-for="Settings.MinifyAngularBindingExpressions">
							<input asp-for="Settings.MinifyAngularBindingExpressions" />
							@Html.DisplayNameFor(m => m.Settings.MinifyAngularBindingExpressions)
						</label>
					</div>
					<div class="form-group">
						<input asp-for="Settings.CustomAngularDirectiveList"
							class="form-control"
							placeholder="@CommonHtmlMinificationStrings.DisplayName_CustomAngularDirectiveList" />
					</div>
				</fieldset>
			</div>
		</div>
	</div>
</form>

@section Scripts {
	@{await Html.RenderPartialAsync("_MinificationFormScriptsPartial"); }
}